package com.zack.gank.gankandroid.view;

import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.ProgressBar;

/**
 * Created by Android on 2017/7/21.
 *
 * webView 加载框
 */
public class ProgressWebChromeClient extends WebChromeClient {

    private ProgressBar pb;
    public ProgressWebChromeClient() {
    }

    public ProgressWebChromeClient(ProgressBar pb){
        this.pb=pb;
    }

    @Override
    public void onProgressChanged(WebView view, int newProgress) {
        pb.setProgress(newProgress);
        if(newProgress==100){
            pb.setVisibility(View.GONE);
        }
        super.onProgressChanged(view, newProgress);
    }
}
